package com.ruoyi.project.wenyanwen.generate.convert;


import com.ruoyi.project.formula.formula.domain.Formula;
import com.ruoyi.project.wenyanwen.generate.domain.sqlite.FormulaSqlite;

import java.util.ArrayList;
import java.util.List;

/**
 * @author jackyshi
 */
public class FormulaConvert extends AbstractConvert {

    @Override
    public List<FormulaSqlite> convert(List<?> list) {

        List<FormulaSqlite> l = new ArrayList<>();

        for (Object obj : list) {

            Formula formula = (Formula) obj;
            FormulaSqlite model = new FormulaSqlite();
            model.setId(formula.getId().intValue());
            model.setFirstPy(formula.getFirstPy());
            model.setName(formula.getName());
            model.setGrade(formula.getGrade());
            model.setChapterId(formula.getChapterId().intValue());
            model.setSubjectId(formula.getSubjectId().intValue());
            model.setSummaryId(formula.getSummaryId().intValue());
            //model.setContent(this.encrypt(formula.getContent()));
            model.setVsort(formula.getVsort().intValue());
            l.add(model);
        }

        return l;
    }
}
